Generating the Raw Index

Step II concerns attaching the current page number to each index command placed in the document. The command used in the generated raw index file may be renamed (in our example, it is changed from \index to \indexentry). The entries are in the exact order in which they appear in the document source. Thus, as long as the current page number is accessible, be it source-language or direct-manipulation based, generating raw index entries is relatively straightforward.

There are minor differences between the two paradigms in this step, however. The generation of raw index entries in a source-language based system, like formatting itself, is by and large a ``batch job''. In a direct-manipulation editor, it is easier to maintain the list of raw index entries incrementally because the document being manipulated is always formatted so the page number is always current.